package com.demo.utils;

/**
 *定义分页显示时前台所需要分页信息
 * @author RenqiuZou
 */
public class ResultPage {

    /**
     * 当前页面
     */
    private int pageNo;
    /**
     * 每页行数
     */
    private int pageSize;
    /**
     * 总记录数
     */
    private int totalRecord;
    /**
     * 总页数
     */
    private int totalPage;

    public static ResultPage newBuilder(Page page){
        ResultPage resultPage = new ResultPage();
        resultPage.setPageNo(page.getPageNo());
        resultPage.setPageSize(page.getPageSize());
        resultPage.setTotalPage(page.getTotalPage());
        resultPage.setTotalRecord(page.getTotalRecord());
        return resultPage;
    }
    public int getPageNo() {
        return pageNo;
    }

    public int getPageSize() {
        return pageSize;
    }

    public int getTotalRecord() {
        return totalRecord;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public void setTotalRecord(int totalRecord) {
        this.totalRecord = totalRecord;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }
}
